package com.xuebusi.ribbon.loadbalance.provider.controller;

import com.xuebusi.ribbon.loadbalance.provider.entity.Product;
import com.xuebusi.ribbon.loadbalance.provider.service.ProductService;
import com.xuebusi.ribbon.loadbalance.provider.vo.ResultVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/product")
public class ProductController {
    @Resource
    private ProductService productService;

    @GetMapping("/{id}")
    public ResultVO<Product> findById(@PathVariable("id") Long id) {
        return productService.findById(id);
    }
}
